////////////////////////////////
//Autor: Mato Kormuth         //
//(C) Mato Kormuth 2010-2011  //
////////////////////////////////

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using MBMC.Dialogs;
using MBMC.Paths;
using MBMC.Web;
using MBMC.Extensions;
using MatoPrograms.ImageFilters;
using MBMC.Dialogs.Premium;

namespace Marble_Blast_Mods_Creator
{
    public partial class Form1 : Form
    {
        bool opened = false;
        bool acexists = false;
        bool gimpexists = false;
        bool terragenexists = false;
        bool checkforupdates = true;
        bool frommbmm = false;
        DateTime dtstarted;
        DateTime dtwork;
        int sec;
        int tim3ms; //startup time
        int modtime; //v skundach celkovy cas pre mod
        
        System.Windows.Forms.RichTextBox modtimertf = new RichTextBox();
        System.Windows.Forms.RichTextBox rtb = new RichTextBox();

        string actualmbfolder = Application.StartupPath.ToString() + "/Marble Blast Gold";

        public Form1(bool checkupdate, bool mbmm)
        {
            InitializeComponent();
            timer3.Start();
            checkforupdates = checkupdate;
            frommbmm = mbmm;
        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                modtimertf.SaveFile(actualmbfolder + "/mbmc/data6.mbmcp", RichTextBoxStreamType.PlainText);
            }
            catch
            {
                statuslabel.Text = "Error opening modtime file(" + actualmbfolder + "/mbmc/data6.mbmcp)!"; 
            }
            folderBrowserDialog1.ShowDialog();
            if (System.IO.File.Exists(folderBrowserDialog1.SelectedPath + "/marbleblast.exe") == true
                || System.IO.File.Exists(folderBrowserDialog1.SelectedPath + "/marbleblastgold.exe") == true)
            {
                actualmbfolder = folderBrowserDialog1.SelectedPath;
                //MessageBox.Show("Mod opened!", "MBMC", MessageBoxButtons.OK, MessageBoxIcon.Information);
                statuslabel.Text = "Mod opened!";
                enableall();
                try
                {
                    modtimertf.LoadFile(actualmbfolder + "/mbmc/data6.mbmcp", RichTextBoxStreamType.PlainText);
                }
                catch
                {
                    statuslabel.Text = "File open error: " + actualmbfolder + "/mbmc/data6.mbmcp";
                    if (System.IO.Directory.Exists(actualmbfolder + "/mbmc/") == false)
                    {
                        System.IO.Directory.CreateDirectory(actualmbfolder + "/mbmc");
                        modtime = 0;
                        statuslabel.Text = "Creating new folder. Modtime set to 0!";
                    }
                    statuslabel.Text = "";
                }
                try
                {
                    modtime = Convert.ToInt32(modtimertf.Text);
                }
                catch
                {
                    //MessageBox.Show("Error loading mod time!", "Mod Opening", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                timer4.Start();

            }
            else
            {
                MessageBox.Show("You must select folder containing marbleblast.exe or marbleblastgold.exe.", "Mato Programs");
                //MessageBox.Show("Error loading mod!", "MBMC", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            enableall();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            if (frommbmm == true)
            {
                //updater
                backgroundWorker2.RunWorkerAsync();

                //MBMC.Dialogs.Opening.WelcomeForm wf = new MBMC.Dialogs.Opening.WelcomeForm();
                //wf.ShowDialog();
                MBMC.Extensions.ExtControl ec = new ExtControl(actualmbfolder);
                ec.ShowDialog();
                acexists = ec.ChechForAC();
                gimpexists = ec.ChechForGIMP();
                terragenexists = ec.ChechForTG();
                timer1.Start();
                label2.Hide();
                disiableall();
                //AboutDialog ad = new AboutDialog();
                //textBox1.Focus();
                //if (MBMCSettings.Default.aboutboxatstartup == true)
                //{
                //    ad.ShowDialog();
                    //button13.Hide();
                //}
                //else
                //{

                //}
                time1ToolStripMenuItem.Text = DateTime.Now.ToString();
                timer2.Start();
                dtstarted = DateTime.Now;

                //R

                //
                timer3.Stop();
                int temp = (tim3ms / 1000);
                label6.Text = "Start time: " + tim3ms.ToString() + " ms (" + temp.ToString() + " sec).";
                //backgroundWorker1.RunWorkerAsync();
                if (MBMCSettings.Default.startupbrowser == 1)
                {
                    System.Threading.Thread th = new System.Threading.Thread(new System.Threading.ThreadStart(RUNBROWSERWEBPAGE));
                    th.Start();
                }
                else
                {
                    webBrowser1.Navigate("about:To load news press Home link");
                }
                //System.Diagnostics.Process p = new System.Diagnostics.Process();
                //p.
                /*if (wf.o == "newmod")
                {
                    MessageBox.Show("New mod wizard bugging... Please copy files manualy and then open mod in mbmc, sorry.");
                    MBMC.Dialogs.NewMod.Step1 s1 = new MBMC.Dialogs.NewMod.Step1();
                    //s1.ShowDialog();
                }
                else
                {
                    openToolStripMenuItem_Click(wf, e);
                }*/


                //---------------------------------------------------------------------KOD NA OTVORENIE Z MARBLE BLAST MODS MANAGER -------------
                RichTextBox rtbload = new RichTextBox();
                try
                {
                    rtbload.LoadFile(Application.StartupPath + "mbmmout.txt", RichTextBoxStreamType.PlainText);
                    actualmbfolder = rtbload.Text;
                    statuslabel.Text = "Mod opened from MBMM!";
                }
                catch
                {

                }
            }
            else
            {
                //t.Start();
                //updater
                backgroundWorker2.RunWorkerAsync();

                MBMC.Dialogs.Opening.WelcomeForm wf = new MBMC.Dialogs.Opening.WelcomeForm();
                wf.ShowDialog();
                MBMC.Extensions.ExtControl ec = new ExtControl(actualmbfolder);
                ec.ShowDialog();
                acexists = ec.ChechForAC();
                gimpexists = ec.ChechForGIMP();
                terragenexists = ec.ChechForTG();
                timer1.Start();
                label2.Hide();
                disiableall();
                AboutDialog ad = new AboutDialog();
                //textBox1.Focus();
                if (MBMCSettings.Default.aboutboxatstartup == true)
                {
                    ad.ShowDialog();
                    //button13.Hide();
                }
                else
                {

                }
                time1ToolStripMenuItem.Text = DateTime.Now.ToString();
                timer2.Start();
                dtstarted = DateTime.Now;

                //R

                //
                timer3.Stop();
                int temp = (tim3ms / 1000);
                label6.Text = "Start time: " + tim3ms.ToString() + " ms (" + temp.ToString() + " sec).";
                //backgroundWorker1.RunWorkerAsync();
                if (MBMCSettings.Default.startupbrowser == 1)
                {
                    System.Threading.Thread th = new System.Threading.Thread(new System.Threading.ThreadStart(RUNBROWSERWEBPAGE));
                    th.Start();
                }
                else
                {
                    webBrowser1.Navigate("about:To load news press Home link");
                }
                //System.Diagnostics.Process p = new System.Diagnostics.Process();
                //p.
                if (wf.o == "newmod")
                {
                    MessageBox.Show("New mod wizard bugging... Please copy files manualy and then open mod in mbmc, sorry.");
                    MBMC.Dialogs.NewMod.Step1 s1 = new MBMC.Dialogs.NewMod.Step1();
                    //s1.ShowDialog();
                }
                else
                {
                    openToolStripMenuItem_Click(wf, e);
                }
            }
            
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            actualTimeToolStripMenuItem.Text = DateTime.Now.ToString();
           //dtwork = DateTime.Now - dtstarted;
            //time2ToolStripMenuItem.Text = dtwork.ToString();
            if (opened == true)
            {
                enableall();
            }
            if (opened == false)
            {
                disiableall();
            }
        }
        /// <summary>
        /// //////////////////////////////////////////////////////////////////////////////////////////////////////////DISABLE  ALL CONTROLS
        /// </summary>
        private void disiableall()
        {
            //foreach (Control c in this.Controls)
            //{
            //    c.Enabled = false;
            //}
            menuStrip1.Enabled = true;
            panel2.Enabled = true;
        }

        private void enableall()
        {
            //foreach (Control c in this.Controls)
            //{
            //    c.Enabled = true;
            //}
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                modtimertf.SaveFile(actualmbfolder + "/mbmc/data6.mbmcp", RichTextBoxStreamType.PlainText);
            }
            catch
            {
                statuslabel.Text = "Error opening modtime file(" + actualmbfolder + "/mbmc/data6.mbmcp)!";
            }
            DialogResult dr = MessageBox.Show("Are you sure want to exit? All unsaved data will be lost!", "Mato Programs", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
            if (dr == DialogResult.Yes)
            {
                StatusLabel1.Text = "Thanks for using!";
                System.Threading.Thread.Sleep(4000);
                Application.Exit();
            }
            else
            {

            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            label2.Show();
            Game_Properties gp = new Game_Properties(actualmbfolder);
            gp.ShowDialog();
            label2.Hide();
        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Project_Properties propertis = new Project_Properties(actualmbfolder, modtime);
            propertis.ShowDialog();
        }

        private void fileToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void button12_Click(object sender, EventArgs e)
        {
            Sound_and_Music sm = new Sound_and_Music(actualmbfolder, acexists);
            sm.ShowDialog();
        }

        private void playToolStripMenuItem_Click(object sender, EventArgs e)
        {
            webBrowser1.Navigate("about:To save RAM memory when is game running, web browesr is turned off.");
            process1.StartInfo.FileName = actualmbfolder + "/marbleblast.exe";
            process1.StartInfo.WorkingDirectory = actualmbfolder;
            process1.Start();
        }

        private void button7_Click(object sender, EventArgs e)
        {
            Missions mi = new Missions(actualmbfolder);
            mi.ShowDialog();
        }

        private void installedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MyExtensions me = new MyExtensions();
            me.ShowDialog();
        }

        private void button11_Click(object sender, EventArgs e)
        {
            //SHOW SKIES DLG
            MBMC.Dialogs.Skies ski = new MBMC.Dialogs.Skies(actualmbfolder, gimpexists, terragenexists);
            ski.ShowDialog();
        }

        private void button10_Click(object sender, EventArgs e)
        {
            MBMCMessageBox msg = new MBMCMessageBox();
            msg.ShowDialog();
            Shapes sp = new Shapes(actualmbfolder, gimpexists);
            sp.ShowDialog();
        }

        private void button9_Click(object sender, EventArgs e)
        {
            Particles pa = new Particles(actualmbfolder, gimpexists);
            pa.ShowDialog();
        }

        private void button8_Click(object sender, EventArgs e)
        {
            webBrowser1.Navigate("about:Paused.....to reload press 'Home' link.");
            Interiors innt = new Interiors(actualmbfolder, gimpexists, MBMCSettings.Default.path_to_torqueconstructor);
            innt.ShowDialog();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            MBMCMessageBox msg = new MBMCMessageBox();
            msg.ShowDialog();
            GameGUI ggui = new GameGUI(actualmbfolder, gimpexists);
            ggui.ShowDialog();
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AboutDialog ad = new AboutDialog();
            ad.ShowDialog();
        }

        private void aboutMarbleBlstModsCreatorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AboutDialog ad = new AboutDialog();
            ad.ShowDialog();
        }

        private void startToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RunMapDVADif rmdd = new RunMapDVADif();
            rmdd.ShowDialog();
        }

        private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            webBrowser1.Url = new Uri("http://www.marbleblastmodscreator.wordpress.com");
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            webBrowser1.GoBack();
        }

        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            webBrowser1.GoForward();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox1_Enter(object sender, EventArgs e)
        {
            /*if (textBox1.Text == "debug")
            {
                button13.Show();
            }*/
        }

        private void button13_Click(object sender, EventArgs e)
        {

        }

        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {

        }

        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {

            webBrowser1.Url = new Uri("http://www.marbleblastmodscreator.wordpress.com");
        }

        private void time1ToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void interiorsTexturesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Textures tex = new Textures(actualmbfolder, MBMCSettings.Default.gimpmanual, MBMCSettings.Default.path_to_gimp);
            tex.ShowDialog();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            ServerScripts ss = new ServerScripts(actualmbfolder);
            ss.ShowDialog();
        }

        private void hueChangerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HueChanger hc = new HueChanger();
            hc.ShowDialog();
        }

        private void texturesToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            webBrowser1.Navigate("about:Paused.....to reload press 'Home' link.");
            Textures tex = new Textures(actualmbfolder, MBMCSettings.Default.gimpmanual, MBMCSettings.Default.path_to_gimp);
            tex.ShowDialog();
        }

        public void RUNBROWSERWEBPAGE()
        {
            webBrowser1.Url = new Uri("http://marbleblastmodscreator.wordpress.com/");
        }

        private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OptionsDialog od = new OptionsDialog();
            od.ShowDialog();
        }

        private void newVersionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //notifyIcon1.ShowBalloonTip(1000);
            MBMCUpdater.Form1 formup = new MBMCUpdater.Form1();
            formup.Show();
        }

        private void oneClickSToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void openWindowToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MBMC.Dialogs.Premium.OCSW ocsw = new MBMC.Dialogs.Premium.OCSW();
            ocsw.ShowDialog();
        }

        private void getFreeBetaPremiumLicenseKeyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MBMC.Dialogs.Premium.GetFreeBetaPremium gfbp = new MBMC.Dialogs.Premium.GetFreeBetaPremium();
            gfbp.ShowDialog();
        }

        private void sendFeedbackToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SendFeedback sf = new SendFeedback("No errors, sendfeedback from menuitem.");
            sf.ShowDialog();
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            /*
            dtwork.Day = 0;
            dtwork.Month = 0;
            dtwork.Year = 0;
             */
            //dtwork.AddSeconds(1);
            sec += 1;
            MatoPrograms.Time.Time timecl = new MatoPrograms.Time.Time();
            MatoPrograms.Time.Time output = timecl.ReturnTime(sec);

            string totooltip = output.Hours.ToString() + "hours:" + output.Minutes.ToString() + "minutes:" + output.Seconds.ToString() + "seconds";
            time2ToolStripMenuItem.Text = totooltip;
        }

        private void interiorsToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Interiors inter = new Interiors(actualmbfolder, gimpexists,MBMCSettings.Default.path_to_torqueconstructor);
            inter.ShowDialog();
        }

        private void interiorsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Interiors i = new Interiors(actualmbfolder, gimpexists, MBMCSettings.Default.path_to_torqueconstructor);
            i.ShowDialog();
        }

        private void soundEffectsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Sound_and_Music sam = new Sound_and_Music(actualmbfolder, acexists);
            sam.ShowDialog();
        }

        public void NEWMOD() ////////////////////////////////////////////////////////////////NEWMOD
        {
            //spravca vytvorenim noveho modu
        }

        public void OPENMOD()
        {
            folderBrowserDialog1.ShowDialog();
            actualmbfolder = folderBrowserDialog1.SelectedPath;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            ClientScripts cs = new ClientScripts(actualmbfolder);
            cs.ShowDialog();
        }

        private void button13_Click_1(object sender, EventArgs e)
        {
            PrimitiveEditor pe = new PrimitiveEditor("::open::");
            pe.ShowDialog();
        }

        private void newMarbleBlastModToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MBMC.Dialogs.NewMod.Step1 s = new MBMC.Dialogs.NewMod.Step1();
            s.ShowDialog();
            enableall();
        }

        private void process1_Exited(object sender, EventArgs e)
        {
            webBrowser1.Url = new Uri("http://www.marbleblastmodscreator.wordpress.com");
        }

        private void removeTempFilesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MatoPrograms.IO.FindingFiles ff = new MatoPrograms.IO.FindingFiles();
            string[] files = ff.FindFiles(actualmbfolder, ".mbmc");
            MBMC.Dialogs.IO.RemoveTempFiles rtf = new MBMC.Dialogs.IO.RemoveTempFiles(files);
            rtf.ShowDialog();
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true)
            {
                MBMCSettings.Default.startupbrowser = 1;
                MBMCSettings.Default.Save();
                MBMCSettings.Default.Upgrade();
                //checkBox1.Checked = false;
            }
            else
            {
                MBMCSettings.Default.startupbrowser = 0;
                MBMCSettings.Default.Save();
                MBMCSettings.Default.Upgrade();
                //checkBox1.Checked = true;
            }
        }

        private void timer3_Tick(object sender, EventArgs e)
        {
            tim3ms += 1;
        }

        private void timer4_Tick(object sender, EventArgs e)
        {
            modtime += 1;
        }

        private void closeModToolStripMenuItem_Click(object sender, EventArgs e)
        {
            disiableall();
            try
            {
                modtimertf.SaveFile(actualmbfolder + "/mbmc/data6.mbmcp", RichTextBoxStreamType.PlainText);
            }
            catch
            {
                statuslabel.Text = "Error opening modtime file(" + actualmbfolder + "/mbmc/data6.mbmcp)!";
            }
        }

        private void intermediateMissionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MBMC.Dialogs.IntermediateMissions im = new IntermediateMissions(actualmbfolder);
            im.ShowDialog();
        }

        private void advancedMissionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MBMC.Dialogs.AdvancedMissions am = new AdvancedMissions(actualmbfolder);
            am.ShowDialog();
        }

        private void customMissionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MBMC.Dialogs.CustomMissions cm = new CustomMissions(actualmbfolder);
            cm.ShowDialog();
        }

        private void newSkyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewSky ns = new NewSky(actualmbfolder);
            ns.ShowDialog();
        }

        private void createSkyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MBMC.Dialogs.CreateSky cs = new CreateSky(terragenexists);
            cs.ShowDialog();
        }

        private void runTerragenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MBMC.Dialogs.CreateSky cs = new CreateSky(terragenexists);
            cs.terrgenstart();
        }

        private void terragenHelpToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MBMC.Dialogs.TerragenHelp th = new TerragenHelp();
            th.Show();
        }

        private void runToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo.FileName = Application.StartupPath + "/data/apps/gimp/bin/gimp.exe";
            p.StartInfo.WorkingDirectory = Application.StartupPath + "/data/apps/gimp/bin/";
            p.Start();
        }

        private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e)
        {
            if (checkforupdates)
            {
                try
                {
                    System.Net.WebClient wc = new System.Net.WebClient();
                    int ver = Convert.ToInt32(wc.DownloadString("http://mbmc.wu.cz/version.txt"));
                    rtb.LoadFile(Application.StartupPath + "/webversion.mbmc", RichTextBoxStreamType.PlainText);
                    if (ver > Convert.ToInt32(rtb.Text))
                    {
                        //MessageBox.Show("New version of Marble Blast Mods Creator has been released! Is highly recommended to download and install latest version of mbmc! Download latest version from MBMC Website(www.marbleblastmodscreator.wordpress.com) or visit MarbleBlast forums mbmc topic to download mbmc latest version.", "NEW VERSION RELEASED READ CAREFULLY!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        MessageBox.Show("New version of marble blast mods creator has been released, updater will be run to update mbmc to latest version. It take only few minutes.", "New version - AutoUpdater");
                        System.Diagnostics.Process ppp = new System.Diagnostics.Process();
                        ppp.StartInfo.FileName = Application.StartupPath + "/MBMCUpdaterPro.exe";
                        ppp.StartInfo.Arguments = "-autoupdate " + MBMCSettings.Default.webver.ToString();
                        ppp.Start();
                        Application.Exit();
                        Application.ExitThread();
                        Application.Exit();

                    }
                }
                catch (Exception exe)
                {
                    string s = "Error in thread: backgroundworker2: " + exe.ToString();
                }
            }
            else
            {

            }
        }

        private void webGalleryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MBMC.Dialogs.NewWebGallery.WebGallery wg = new MBMC.Dialogs.NewWebGallery.WebGallery();
            wg.ShowDialog();
        }

        private void updateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //backgroundWorker2.RunWorkerAsync();
            System.Diagnostics.Process ppp = new System.Diagnostics.Process();
            ppp.StartInfo.FileName = Application.StartupPath + "/MBMCUpdaterPro.exe";
            ppp.StartInfo.Arguments = "-autoupdate " + rtb.Text;
            ppp.Start();
            Application.Exit();

        }

        private void defaultMarblecsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            statuslabel.Text = "about: Your page is loading.....";
            //webBrowser1.Navigate("about: Your page is loading.....");
            webBrowser1.Navigate("http://marbleblastmodscreator.wordpress.com/tutorials/help/");
        }

        private void openModManagerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            mbmmprocess.StartInfo.FileName = Application.StartupPath + "/MBMM.exe";
            mbmmprocess.Start();
            Application.Exit();
        }

        private void myMarbleBlastModsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            mbmmprocess.StartInfo.FileName = Application.StartupPath + "/MBMM.exe";
            mbmmprocess.Start();
            Application.Exit();
        }
    }
}